How can I configure Xcode to put '{' where I want it in generated files

Posted by djhworld on Stack Overflow See other posts from Stack Overflow or by djhworld
Published on 2010-04-10T13:50:08Z Indexed on 2010/04/10 13:53 UTC
Read the original article Hit count: 213

Filed under:
|
|

I know this is a fairly contentious issue amongst programmers, but when developing I like my IDE to position the opening curly bracket underneath the method/interface/control declaration, for illustrative purposes: -

This is how Xcode automatically generates skeleton methods with the { at the end: -

-(void) isTrue:(BOOL)input {
    if(input) {
        return YES;
    }
    else {
        return NO;
    }
}

This is how I like to lay out my code (which I believe is called the Allman style): -

-(void) isTrue:(BOOL)input 
{
    if(input) 
    {
        return YES;
    }
    else 
    {
        return NO;
    }
}

I'm just wondering if there's any configuration switch in Xcode to enable this style of development? It's really annoying when typing out if/else statements as it tends to auto-complete the else clause with the { at the end of the line which just looks silly if you like developing with them underneath.

Or am I being unreasonable? Is Objective-C supposed to adhere to a standard defined by Apple?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about xcode